#include <iostream>
using namespace std;

signed main()
{
    int n;
    cin>>n;
    int f[10005] = {0};
    for(int i=1;i<=n;i++){
        int t;
        cin>>t;
        f[abs(i-t)]++;
    }
    for(int i=n;i>=0;i--){
        if(f[i]>1)    cout<<i<<" "<<f[i]<<"\n";
    }
    return 0;
}
